# compile macro
CC		= clang++
CFLAGS	= -O2 -Wall -std=c++11
LDFLAGS	= -lm 
INCLUDES= -I/usr/local/include
LIBSHAREPATH=-L/usr/lib64/mysql -lmysqlclient -lpthread  \
			 -Llib -lleveldb \
			 -Wl,-rpath=lib


# recursive make
.PHONY: subdirs ${SUBDIRS} cleansubdirs
subdirs: ${SUBDIRS}
${SUBDIRS}:
	${MAKE} -C $@ all

	
# recursive make clean
cleansubdirs:
	@for dir in ${SUBDIRS}; do \
		${MAKE} -C $$dir clean; \
	done

	
# dependence
%.o: %.cpp
	${CC} ${CFLAGS} ${INCLUDES} -c $< -o $@
%.o: %.cc
	${CC} ${CFLAGS} ${INCLUDES} -c $< -o $@	
